package day09.Consume2Producer;import java.util.concurrent.TimeUnit;/** * @Auther: sky * @Date: 2019/3/12 23:43 * @Description: */public class Producer extends Thread {    @Override    public void run() {        synchronized (Constants.lock){                try {                    System.out.println(Thread.currentThread().getName());                    Constants.lock.notify();                    Constants.flag=false;                    TimeUnit.SECONDS.sleep(5);                    System.out.println("我是生产者，生产成功");                } catch (Exception e) {                    e.printStackTrace();                }            }    }}